const str = '<script setup></script>'
export default [
  {
    label: '新的组件',
    code:
      `<template>
  <div class="vue3">
  </div>
</template>
${str}
<style  scoped lang="scss">
</style>
    `
  },
  {
    label: '新的页面',
    code:
      `<template>
  <div class="app-container">
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:post:add']">新增</el-button>
      </el-col>
    </el-row>
    <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
      <template v-for="(x, y) in tableColumns" :key="y">
        <el-table-column :label="x.title" align="center" :prop="x.name" :width="x.width" v-if="!x.not">
          <template #default="scope">
            {{ scope.row[x.name] }}
          </template>
        </el-table-column>
      </template>
      <el-table-column label="创建时间" align="center" prop="createTime" width="150">
        <template #default="scope">
          <span>{{ parseTime(scope.row.createTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" width="180px" fixed="right">
        <template #default="scope">
          <el-button @click="handleUpdate(scope.row)" v-hasPermi="['build:license:edit']">修改</el-button>
          <el-button type="danger" @click="handleDelete(scope.row)" v-hasPermi="['build:license:remove']">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
      v-model:limit="queryParams.pageSize" @pagination="getList" />
    <el-dialog :title="title" v-model="open" width="800px">
      <el-form ref="formRef" :model="form" size="default" label-width="150px">
        <el-form-item v-for="(x, y) in tableColumns" :label="x.title" :prop="x.name">
          <template v-if="x.islong">
            <el-input v-model="form[x.name]" :placeholder="'请输入' + x.title" type="textarea" rows="3" />
          </template>
          <template v-else>
            <el-input v-model="form[x.name]" :placeholder="'请输入' + x.title" />
          </template>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <div>
          <el-button type="primary" @click="submit">保 存</el-button>
          <el-button @click="() => { open = false }">取 消</el-button>
        </div>
      </div>
    </el-dialog>
  </div>
</template>
${str}
<style scoped lang="scss">
</style>
    `
  },
  {
    label: '新的接口',
    code:
      `import request from '@/utils/request'
// 查询
export function listFood(params) {
  return request({
    url: '/qb/build/food/list',
    method: 'post',
    params
  })
}

// 新增
export function addFood(data) {
  return request({
    url: '/qb/build/food/add',
    method: 'post',
    data: data
  })
}

// 修改
export function updateFood(data) {
  return request({
    url: '/qb/build/food/edit',
    method: 'post',
    data: data
  })
}

// 删除
export function delFood(id) {
  return request({
    url: '/qb/build/food/del' + id,
    method: 'delete'
  })
}
`
  },
  {
    label: '打包组件',
    code: `export { default as demo } from './demo.vue'
    `
  },
  {
    label: '导出整体',
    code: `export dafalut []`
  },
  {
    label: '导出部分',
    code: `export const demo = []`
  }
]
